<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class ClasssCreate extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        /**
         * '1': '未开班',
         * '2': '已开班',
         * '3': '已毕业'
         */
        return [
            'class_name' => 'bail|required|min:1|max:20',
            'class_type' => 'bail|required|in:1,2,3', // 1: '正式班', 2: '临时班'
            'capacity' => 'bail|required',
            'remark' => 'bail|required|min:0|max:100',
            'status' => 'bail|required|in:1,2,3'
        ];
    }
}
